<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8"/>
    <title>后台登录</title>
    <meta name="author" content="DeathGhost" />
    <link rel="stylesheet" type="text/css" href="../../static/css/style.css" th:href="@{/css/style.css}" tppabs="../../static/css/style.css" />
    <style>
        body{height:100%;background:#16a085;overflow:hidden;}
        canvas{z-index:-1;position:absolute;}
    </style>
    <script src="../../static/js/jquery.js" th:src="@{/js/jquery.js}"></script>
    <script src="../../static/js/verificationNumbers.js" th:src="@{/js/verificationNumbers.js}" tppabs="../../static/js/verificationNumbers.js"></script>
    <script src="../../static/js/Particleground.js" th:src="@{/js/Particleground.js}" tppabs="../../static/js/Particleground.js"></script>
    <script>
        $(document).ready(function() {
            //粒子背景特效
            $('body').particleground({
                dotColor: '#5cbdaa',
                lineColor: '#5cbdaa'
            });
            //验证码
            createCode();
            //测试提交，对接程序删除即可
            $(".submit_btn").click(function(){
                $.post("/admin/login", $(".form").serialize(),function(data){
                    if (strings.isEmpty(data.message)) {
                            alert("用户名或密码错误");
                }else {
                        location.href = "http://localhost:8080/index";
                    }
                });
            });
        });
    </script>
</head>
<body>
<dl class="admin_login">
    <dt>
        <strong>后台管理系统</strong>
        <em>Blog System</em>
    </dt>
    <form class="ui large form" method="post" action="#" th:action="@{/admin/login}" >
        <dd class="user_icon">
            <input type="text" name="username" placeholder="用户名" class="login_txtbx"/>
        </dd>
        <dd class="pwd_icon">
            <input type="password" name="password" placeholder="密码" class="login_txtbx"/>
        </dd>
        <dd class="val_icon">
            <div class="checkcode">
                <input type="text" id="J_codetext" placeholder="验证码" maxlength="4" class="login_txtbx">
                <canvas class="J_codeimg" id="myCanvas" onclick="createCode()">对不起，您的浏览器不支持canvas，请下载最新版浏览器!</canvas>
            </div>
            <input type="button" value="验证码核验" class="ver_btn" onClick="validate();">
        </dd>
        <dd>
            <input type="button" value="立即登陆" class="submit_btn"/>
        </dd>
    </form>
    <dd>
        <p th:unless="${#strings.isEmpty(message)}" th:text="${message}">用户名和密码错误</p>
    </dd>
</dl>
</body>
</html>
